import Vue from 'vue'
import Router from 'vue-router'
import Login from "@/components/Login";
import Home from "@/components/Home";
import Introductor from "@/components/system/Introductor";
import MenuManager from "@/components/system/MenuManager";
import RoleManager from "@/components/system/RoleManager";
import UserManager from "@/components/system/UserManager";
import Button from "@/components/system/Menu/Button";
import Folder from "@/components/system/Menu/Folder";
import MenuDetail from "@/components/system/Menu/MenuDetail";

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Login',
      component: Login
    }, {
      path: '/home',
      name: 'Home',
      component: Home,
      children: [
        {
          path: '/introduce',
          name: 'Introductor',
          component: Introductor
        },
        {
          path: '/user/list',
          name: 'UserManager',
          component: UserManager
        },
        {
          path: '/role/list',
          name: 'RoleManager',
          component: RoleManager
        },
        {
          path: '/menu/list',
          name: 'MenuManager',
          component: MenuManager,
          props: true,
          children: [
            {
              path: '/menu/button',
              name: 'Button',
              component: Button,
              props: true
            },
            {
              path: '/menu/menu',
              name: 'MenuDetail',
              component: MenuDetail,
              props: true
            },
            {
              path: '/menu/folder',
              name: 'Folder',
              component: Folder,
              props: true
            }
          ]
        }
      ]
    }
  ],
  'mode':'history'
})
